package com.lc.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

/**
 * Author:LiChuang
 * Date: 2022/8/9 16:59
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
@RefreshScope //添加一个刷新的作用域，可以实现动态修改远端的配置文件
public class Hero {
    @Value("${hero.name}")
    private String name;
    @Value("${hero.age}")
    private Integer age;
    @Value("${hero.address}")
    private String address;
}
